<?php
/**
* Hellos View for Hello World Component
*
* @package Joomla.Tutorials
* @subpackage Components
* @link http://dev.joomla.org/component/option,com_jdwiki/
Itemid,31/id,tutorials:components/
* @license GNU/GPL
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view' );
/**
* Hellos View
*
* @package Joomla.Tutorials
* @subpackage Components
*/
class HellosViewHellos extends JView
{
	/**
	* Hellos view display method
	* @return void
	**/
	function display($tpl = null)
	{
	//get the hello
			$hello =& $this->get('Data');
			$isNew = ($hello->id < 1);
			$text = $isNew ? JText::_( 'New' ) : JText::_( 'Edit' );
			JToolBarHelper::title( JText::_( 'Hello' ).': <small><small>[ ' .
			$text.' ]</small></small>' );
			JToolBarHelper::save();
			if ($isNew) {
				JToolBarHelper::cancel();
			} else {
				// for existing items the button is renamed `close`
				JToolBarHelper::cancel( 'cancel', 'Close' );
			}
			$this->assignRef('hello', $hello);
			parent::display($tpl);
	}
}